#include <stdio.h>
#define LENGTH 5


int main(){
    int arr[] = {5, 2, 4, 1, 4};
    int index_of_min = 0;
    int min = arr[0];

    for(int i = 0; i < LENGTH; i++){
        min = (min < arr[i]) ? min : arr[i];
        index_of_min = (min < arr[i]) ? index_of_min : i;
    }

    printf("最小值:%d,索引:%d\n", min, index_of_min);

    return 0;

}